Focus control device capable of preventing object from being excluded from focusing target, focus controlling method, and storage medium

ABSTRACT

A focus control device that is capable of preventing an object intended by a user from being excluded from a focusing target. The focus control device performs focus adjustment by using one of autofocus and manual focus. When focus control is switched from the autofocus to the manual focus, and then switched to the autofocus, whether to perform focus adjustment with settings of the autofocus set before being switched to the manual focus, or with settings of the autofocus to be set after being switched from the manual focus, is controlled according to whether or not there is an object focused by the manual focus.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to a focus control device that is capableof preventing an object from being excluded from a focusing target, afocus controlling method, and a storage medium.

Description of the Related Art

A digital camera has an autofocus (hereinafter referred to as AF)function of performing focus control so as to automatically focus on apredetermined area on a screen. A variety of methods are used forselecting an area as the AF target. As a related art, there have beenproposed techniques in Japanese Laid-Open Patent Publication (Kokai) No.2016-206352 and Japanese Laid-Open Patent Publication (Kokai) No.2010-97167. In the technique disclosed in Japanese Laid-Open PatentPublication (Kokai) No. 2016-206352, when the focus control is switchedfrom AF (autofocus) to MF (manual focus), a plurality of small areas areset in an area set by AF. Then, when the focus control is switched fromMF to AF, an AF area determined to be in an in-focus state out of theplurality of areas set by MF is set. In the technique disclosed inJapanese Laid-Open Patent Publication (Kokai) No. 2010-97167, the focuscontrol is performed by a manual operation, and in a case where the bestfocus on an object is obtained, the in-focus range is divided into aplurality of areas, and the position of an AF frame is automatically setfrom the divided areas.

In the technique disclosed in Japanese Laid-Open Patent Publication(Kokai) No. 2016-206352, the area based on the MF operation is set inthe AF area set for the object. In a case where an object as thefocusing target is outside the AF area set before the MF operation, theAF control cannot be performed for the object as the focusing target,and hence it is impossible to focus on the object intended by the user.In the technique disclosed in Japanese Laid-Open Patent Publication(Kokai) No. 2010-97167, the AF position is set after the MF operationhas been performed. Therefore, in a variety of scenes, a user isrequired to perform the MF operation for focusing on an object aimed bythe user whenever photographing is performed and required to have a highlevel of skill. As a result, the user sometimes fails in focusing on theintended object. This problem can occur in an apparatus that controlsdesired focusing, other than an image capturing apparatus, such as adigital camera.

SUMMARY OF THE INVENTION

The present invention provides a focus control device that is capable ofpreventing an object intended by a user from being excluded from afocusing target, a focus controlling method, and a storage medium.

In a first aspect of the present invention, there is provided a focuscontrol device including a processor, and a memory storing a programwhich, when executed by the processor, causes the focus control deviceto: perform focus adjustment by using one of autofocus and manual focus;and control, when focus control is switched from the autofocus to themanual focus, and then switched to the autofocus, whether to performfocus adjustment with settings of the autofocus set before beingswitched to the manual focus or with settings of the autofocus to be setafter being switched from the manual focus, according to whether or notthere is an object focused by the manual focus.

In a second aspect of the present invention, there is provided a focuscontrol device including a processor, and a memory storing a programwhich, when executed by the processor, causes the focus control deviceto: perform focus adjustment by using one of autofocus and manual focus,and perform, when the focus control is switched from the autofocus tothe manual focus, and then switched from the manual focus to theautofocus, control for expanding a ranging target area to be set bysettings of the autofocus after being switched from the manual focusfrom a ranging target area set by settings of the autofocus before beingswitched to the manual focus.

In a third aspect of the present invention, there is provided a focuscontrolling method that makes it possible to perform focus adjustment byusing one of autofocus and manual focus, including controlling, whenfocus control is switched from the autofocus to the manual focus, andthen switched to the autofocus, whether to perform focus adjustment withsettings of the autofocus set before being switched to the manual focus,or with settings of the autofocus to be set after being switched fromthe manual focus, according to whether or not there is an object focusedby the manual focus.

In a fourth aspect of the present invention, there is provided a focuscontrolling method that makes it possible to perform focus adjustment byusing one of autofocus and manual focus, including performing, when thefocus control is switched from the autofocus to the manual focus, andthen switched from the manual focus to the autofocus, control forexpanding a ranging target area to be set by settings of the autofocusafter being switched from the manual focus from a ranging target areaset by settings of the autofocus before being switched to the manualfocus.

According to the present invention, it is possible to prevent an objectintended by a user from being excluded from a focusing target.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments (with reference to theattached drawings).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram showing an example of the configuration of an imagecapturing apparatus.

FIGS. 2A to 2D are diagrams showing an example of ranging target AFareas.

FIG. 3 is a flowchart of the whole process of focus control.

FIG. 4 is a flowchart of an initialization condition-monitoring process.

FIG. 5 is a flowchart of a focus mode selection process.

FIG. 6 is a flowchart of an MF process.

FIGS. 7A to 7H are diagrams showing a positional relationship betweenobjects and a focus lens and examples of a variety of screens.

FIG. 8 is a flowchart of an example of a process for setting a rangingtarget AF area and an AF control mode immediately after the focus modeis switched from an MF control mode to the AF control mode.

FIG. 9 is a diagram showing an example of shifts of AF states in an AFprocess.

FIG. 10 is a flowchart of the AF process performed according to the AFcontrol mode.

FIG. 11 is a continuation of FIG. 10.

DESCRIPTION OF THE EMBODIMENTS

The present invention will now be described in detail below withreference to the accompanying drawings showing embodiments thereof.However, the configuration described in the following embodiment isgiven only by way of example, and is by no means intended to limit thescope of the present invention.

FIG. 1 is a diagram showing an example of the configuration of an imagecapturing apparatus 100 according to the present embodiment. The imagecapturing apparatus 100 is, for example, a digital camera or a videocamera. The image capturing apparatus 100 corresponds to a focus controldevice that performs focus control. The focus control device may be anelectronic device, such as a smartphone and a tablet terminal. Further,in a case where the image capturing apparatus 100 has a communicationfunction, an external server (information processing apparats) mayfunction as the focus control device, and the image capturing apparatus100 may perform wireless communication with the external server, wherebycontrol of the present embodiment may be realized.

The image capturing apparatus 100 includes an image capturing opticalsystem for imaging light from an object. In the illustrated example inFIG. 1, the image capturing optical system is formed by a first grouplens 101, a zoom lens 102, a diaphragm 103, a second group lens 104, anda focus lens 105 (focus compensator lens). The first group lens 101 andthe second group lens 104 are fixed lenses. The zoom lens 102 performs azooming operation by moving in an optical axis direction. The focus lens105 has a function of correcting movement of a focusing surface, causedby the zooming operation, and a focus adjustment function. The diaphragm103 has a predetermined diaphragm function. The image capturing opticalsystem further includes a focus ring, not shown, and the focus lens 105moves in the optical axis direction according to an amount of manualoperation of the focus ring.

An image sensor 106 is a photoelectric conversion element, such as a CCDsensor or CMOS sensor. Light incident through the image capturingoptical system forms an image on the image sensor 106. The image sensor106 photoelectrically converts the light forming the image and outputselectrical signals. A CDS/AGC circuit 107 samples the electrical signalsoutput from the image sensor 106 and adjusts a gain. A camerasignal-processing circuit 108 performs image processing on signalsoutput from the CDS/AGC circuit 107 to generate image capturing signals(image). A monitor device 109 is a display, such as an LCD, and displaysan image output from the camera signal-processing circuit 108. Further,the monitor device 109 displays not only the image, but also informationon a photographing mode of the image capturing apparatus 100 andinformation on an AF ranging frame serving as a guide of a set focusdetection area, and so forth. A recording device 110 records the imageoutput from the camera signal-processing circuit 108 in a recordingmedium, such as a magnetic tape, an optical disk, and a semiconductormemory.

A zoom lens-driving source 111 is a driving source for moving the zoomlens 102 in the optical axis direction to perform a zooming operation. Afocus lens-driving source 112 is a driving source for moving the focuslens 105 in the optical axis direction to perform focus adjustment. Thezoom lens-driving source 111 and the focus lens-driving source 112 areeach implemented by an actuator, such as a stepping motor, a DC motor, avibration motor, or a voice coil motor.

A phase difference AF gate 113 is a gate for passing first focusdetection signals and second focus detection signals detected by thephase difference AF method from pixels associated with respective focusdetection areas in the AF frame, out of pixels set by a rangingarea-setting section 118. A phase difference AF signal processor 114performs correlation calculation based on each associated two focusdetection signals passing through the phase difference AF gate 113 andcalculates an image displacement amount for each focus detection area.The calculated image displacement amounts are output to a focus positiondetection section 119 of a camera microcomputer 115. The cameramicrocomputer 115 includes the focus position detection section 119, afocus determination section 120, a focus controller 121, and a zoomcontroller 122.

By using the focus detection method based on the phase difference AFmethod, the focus position detection section 119 calculates an amount ofdisplacement (defocus amount) between a current focus position and anin-focus position on the imaging surface of the image sensor 106 basedon the image displacement amounts calculated by the phase difference AFsignal processor 114. The focus position detection section 119 sends thecalculated defocus amount to the focus controller 121. Further, thefocus position detection section 119 converts the calculated defocusamount to a driving amount of the focus lens 105 and sends the drivingamount to the focus determination section 120. The focus determinationsection 120 sends information on the driving amount of the focus lens105 to the focus controller 121. The focus controller 121 controls thefocus lens-driving source 112 to drive the focus lens 105 based on thereceived information on the driving amount and thereby executes the AFcontrol for automatically performing focus adjustment.

A TV-AF gate 116 and a TV-AF signal processor 117 are provided torealize a TV-AF method employed as the AF method other than the phasedifference AF method. The TV-AF gate 116 supplies only signals of anarea used for focus detection by the TV-AF, out of signals of all pixelsoutput from the CDS/AGC circuit 107, to the TV-AF signal processor 117.The TV-AF signal processor 117 applies e.g. a method of extractingspecific frequency components using a filter to the image signals withinthe TV-AF focus area (within the AF frame in the present embodiment)which are supplied from the TV-AF gate 116. Then, the TV-AF signalprocessor 117 generates a TV-AF evaluation value at which the sharpnessof an image (degree of contrast) becomes the highest in the focusposition. The generated TV-AF evaluation value is sent to the focusdetermination section 120. Further, the generated TV-AF evaluation valueis sent to the focus controller 121. The focus controller 121 controlsthe focus lens-driving source 112 based on the received TV-AF evaluationvalue to drive the focus lens 105, thereby performing the AF control bythe TV-AF method.

The ranging area-setting section 118 sets a pixel group out of allpixels of the image sensor 106, from which the first focus detectionsignals and the second focus detection signals to be input to the phasedifference AF gate 113 are read out. The ranging area-setting section118 can specify an area of pixels from which signals are read as signalsfor the phase difference AF, as desired. A memory 123 stores programsexecuted by the focus controller 121 of the camera microcomputer 115 anddesired information. The camera microcomputer 115 including the focuscontroller 121 forms a CPU. The CPU of the camera microcomputer 115executes the programs stored in the memory 123, whereby the controlaccording to the present embodiment is achieved. The cameramicrocomputer 115 may be realized by a predetermined programmingcircuit. The camera microcomputer 115 or the focus controller 121corresponds to the focus control device.

In the present embodiment, it is possible to switch between the twofocus control modes of an AF (autofocus) mode in which focus adjustmentis automatically performed and an MF (manual focus) mode in which focusadjustment is manually performed by a user. The focus controller 121 ofthe camera microcomputer 115 can alternately switch between the AF modeand the MF mode, based on a user's operation.

Next, a method of setting the ranging area, which is performed by theranging area-setting section 118, will be described. In the presentembodiment, the focus controller 121 sets one of the following tworanging target AF areas based on a user's operation:

first ranging target AF area (standard)

second ranging target AF area (wide)

In a case where the first ranging target AF area (standard) is set, theimage capturing apparatus 100 performs AF with respect to an object inthe vicinity of the center of the screen. In a case where the secondranging target AF area (wide) is set, the image capturing apparatus 100also performs AF with respect to an object in a wide area including arange outside the first ranging target AF area (standard). Basically,there is a high probability that a main object as the photographingtarget exists in the vicinity of the center of the screen. For thisreason, the first ranging target AF area (standard) is an area set toexclude an object in a peripheral area of the screen (area other thanthe center and its vicinity of the screen). On the other hand, there isa case where the main object exists outside the first ranging target AFarea (standard). The second ranging target AF area (wide) is an area forperforming AF also with respect to an object positioned outside thefirst ranging target AF area (standard). That is, the second rangingtarget AF area (wide) is an area obtained by expanding the first rangingtarget AF area (standard).

FIGS. 2A to 2D are diagrams showing an example of ranging target AFareas. FIG. 2A is a diagram showing a maximum ranging area 201 set for acaptured image 200 formed by image capturing signals acquired from thecamera signal-processing circuit 108. The ranging area 201 is dividedinto a plurality of ranging areas in a grid shape. The following rangingtarget AF are also each divided into a plurality of ranging areas in agrid shape. FIG. 2B is a diagram showing a first ranging target AF area(standard) 202. FIG. 2C is a diagram showing a second ranging target AFarea (wide) 203. The first ranging target AF area (standard) 202 is anarea arranged in the vicinity of the center of the screen. The secondranging target AF area (wide) 203 also includes an area outside thefirst ranging target AF area (standard) 202 as the ranging target AFarea. FIG. 2D is a diagram showing a third ranging target AF area(catch) 204. The third ranging target AF area (catch) 204 is a rangingtarget AF area used when AF is started or used for monitoring for a newobject. The third ranging target AF area (catch) 204 is an AF area usedas an auxiliary area when the first ranging target AF area (standard)202 is selected.

The image capturing apparatus 100 can change the ranging target AF areato one of the ranging target AF areas 202 to 204 according to a state ofan object and a state of AF from the maximum ranging area 201. Thismakes it possible to perform control such that an object aimed by a useris maintained to be in focus. When the AF control is performed, thefocus controller 121 provides a driving command to the focuslens-driving source 112, using at least one or more ranging results outof a plurality of ranging results obtained from the ranging target AFareas 202 to 204.

Next, the AF control mode will be described. The image capturingapparatus 100 has the following two AF control modes. The imagecapturing apparatus 100 can select, as desired, the AF control mode setduring AF from the following two AF control modes:

first AF control mode (normal)

second AF control mode (limit)

In a case where the first AF control mode (normal) is set, the imagecapturing apparatus 100 performs the AF control by giving priority to anarea in the center and its vicinity of the screen (center priority AFcontrol). In the case where the first AF control mode (normal) is set,the AF control is performed with respect to a close object. In the casewhere the first AF control mode (normal) is set, the focus controller121 detects an object existing in the third ranging target AF area(catch) 204 in the center of the screen based on a ranging result, andperforms the focusing operation according to the ranging result. In acase where an object which has been once detected moves within thescreen, the focus controller 121 continues the AF control with respectto the detected object while the object is moving within the range ofthe first ranging target AF area (standard) 202. With this, automatictracking of the object is performed.

In a case where an object is detected based on a ranging result on anearer side than the current focus lens position in the third rangingtarget AF area (catch) 204 in the center and its vicinity of the screen,the focus controller 121 detects that a new main object has appeared. Inthis case, the focus controller 121 performs the focus control accordingto a ranging result on the new main object detected from the thirdranging target AF area (catch) 204.

In a case where the first AF control mode (normal) is set, tosequentially focus on objects appearing in the nearer side in thecenter, the focus controller 121 performs versatile AF control capableof performing focusing operation in a variety of scenes. The versatileAF control refers to AF control for selecting a focusing area fromwithin a range formed by limiting a ratio of the AF control target areato the screen to some degree. With this, it is possible to prevent theAF control from being erroneously performed on an object positioned in aperipheral portion of the screen (such as a wall and the ground).

In a case where the second AF control mode (limit) is set, the focuscontroller 121 performs the AF control by giving priority to thein-focus state (in-focus priority AF control). In this case, the focuscontroller 121 determines, from a ranging result, an object which isin-focus or substantially in-focus when the focus lens 105 is in acurrent position, and performs the focusing operation according to theranging result. In the case where the second AF control mode (limit) isset, the focus controller 121 does not change the object as the AFtarget even when a new object appears in the third ranging target AFarea (catch) 204. The second AF control mode (limit) is different fromthe first AF control mode (normal) in this point.

Therefore, in the second AF control mode (limit), even when a new objectappears, instead of changing the object, the focus controller 121performs the focusing operation only with respect to the object aimed bythe user. That is, the second AF control mode (limit) is a highlydedicated mode of AF control in which the focusing operation isperformed only with respect to an object intended by a user. Settings ofthe first AF control mode (normal) and settings of the second AF controlmode (limit) are in an exclusive relation. However, in the second AFcontrol mode (limit), in a case where an object in the vicinity of thefocusing point disappears, a case where a specific condition issatisfied, and the like cases, the AF control mode is shifted from thesecond AF control mode (limit) to the first AF control mode (normal).

Next, a relationship between the AF control mode and the ranging targetAF area will be described. The image capturing apparatus 100 operates inthe first AF control mode (normal) in the normal state. When anoperation for changing from AF to MF is performed by a user, the focuscontroller 121 changes the AF control mode to the MF control mode.Examples of the operation for changing the focus control from AF to MFinclude a focus ring operation performed by the user. The focuscontroller 121 maintains the MF control mode in a case where the focusring operation is continued, and switches the focus control from the MFcontrol mode to the AF control mode when the focus ring operation isterminated. Before the image capturing apparatus 100 shifts from the MFcontrol mode to the AF control mode, the focus controller 121 identifiesthe position of an object, and determines a AF control mode and aranging target AF area.

If a user performs the focus ring operation, the mode is changed fromthe AF control mode to the MF control mode. This means that the user hasperformed an operation for requesting the image capturing apparatus 100to change a main object automatically identified in the AF control mode.Then, to identify an object aimed by the user in the MF control, thefocus controller 121 performs the following determinations when the MFcontrol mode is changed to the AF control mode:

(1) determination of whether the AF control mode is the first AF controlmode (normal) or the second AF control mode (limit), and

(2) determination of whether the ranging target AF area is the firstranging target AF area (standard) or the second ranging target AF area(wide).

The above-mentioned determination (1) is determination concerning theoptical axis direction (Z axis). In a case where focusing is not to beperformed on anything other than the object aimed by the user, the firstAF control mode (normal) is changed to the second AF control mode(limit). The above-mentioned determination (2) is determinationconcerning an X-Y direction (direction of vertical and lateral movementwithin the screen) orthogonal to the optical axis direction (Z axis). Ina case where the object aimed by the user exists in an area other thanthe center, the first ranging target AF area (standard) is changed tothe second ranging target AF area (wide) using the user's operation as atrigger.

Next, the focus control will be described. The following focus controlprocess is realized by the focus controller 121 of the cameramicrocomputer 115 that executes a predetermined program. FIG. 3 is aflowchart of the whole process of the focus control. The process in FIG.3 is repeatedly executed e.g. at a period of readout of image capturingsignals (image) from the image sensor 106. In a step S301, the focuscontroller 121 executes a focus mode selection process. In the focusmode selection process, which of the AF control mode and the MF controlmode is to be set is determined. Details of the focus mode selectionprocess will be described hereinafter.

In a step S302, the focus controller 121 determines whether or not thefocus mode selected in the step S301 is the AF control mode. If theanswer to the question of the step S302 is affirmative (YES) (if the AFcontrol mode has been selected), the process proceeds to a step S303. Inthe step S303, the focus controller 121 determines whether or not it isimmediately after termination of the MF operation. In a case where theimage capturing signals (image) were read out immediately before in theMF control mode, and the current mode (mode after one period) is the AFcontrol mode, the focus controller 121 determines that it is immediatelyafter termination of the MF operation.

If the answer to the question of the step S303 is affirmative (YES) (ifit is immediately after the MF operation), the process proceeds to astep S304. In the step S304, the focus controller 121 sets the rangingtarget AF area and the AF control mode according to the case where it isimmediately after the MF operation. At this time, the focus controller121 sets one of the first ranging target AF area (standard) and thesecond ranging target AF area (wide) as the ranging target AF area.Further, the focus controller 121 sets one of the first AF control mode(normal) and the second AF control mode (limit) as the AF control mode.

In a step S305, the focus controller 121 performs an AF process based onthe settings set in the step S304. Details of this process will bedescribed hereinafter. In a step S306, the focus controller 121 performsa process for monitoring a condition for initializing the ranging targetAF area and the AF control mode (initialization condition-monitoringprocess). At this time, the focus controller 121 performs a process formonitoring the condition for initializing the ranging target AF area andthe AF control mode set in the step S304 and processing for settingON/OFF of an initialization flag. Details of this process will bedescribed hereinafter.

In a step S307, the focus controller 121 determines whether or not theinitialization flag is ON. If the answer to the question of the stepS307 is affirmative (YES) (if the initialization flag is ON), theprocess proceeds to a step S308. On the other hand, if the answer to thequestion of the step S307 is negative (NO) (if the initialization flagis OFF), the focus controller 121 terminates the focus control processin FIG. 3. In the step S308, the focus controller 121 returns theranging target AF area to the first ranging target AF area (standard).In a step S309, the focus controller 121 returns the AF control mode tothe first AF control mode (normal). Then, the focus controller 121terminates the focus control process in FIG. 3.

As the focusing operation of the present embodiment, there is assumed anoperation performed in a case where an MF operation is performed afteran AF operation has been performed, and then an AF operation isperformed again. In an AF setting set by the AF operation performedbefore the MF operation (first setting), the ranging target AF area andthe AF control mode are set to the first ranging target AF area(standard) and the first AF control mode (normal), respectively. An AFsetting set by the AF operation performed after the MF operation (secondsetting) is sometimes different from the first setting. This will bedescribed hereinafter in detail.

If the answer to the question of the step S303 is negative (NO) (if itis not immediately after the MF operation), the process proceeds to astep S310. In the step S310, the focus controller 121 sets the rangingtarget AF area and the AF control mode according the case where it isnot immediately after the MF operation, and performs the AF processaccording to the settings. At this time, the focus controller 121 setsthe first ranging target AF area (standard) and the first AF controlmode (normal) as the ranging target AF area and the AF control mode,respectively. Then, the focus controller 121 terminates the focuscontrol process in FIG. 3.

If the answer to the question of the step S302 is negative (NO) (if theMF control mode has been selected), the process proceeds to a step S311.In the step S311, the focus controller 121 performs an MF process.Details of the MF process will be described hereinafter. Then, the focuscontroller 121 terminates the focus control process in FIG. 3.

Next, the initialization condition-monitoring process performed in thestep S306 in FIG. 3 will be described. FIG. 4 is a flowchart of theinitialization condition-monitoring process. The initializationcondition-monitoring process is a process for monitoring whether or notan operation for changing a photographing scene has been performed by auser. In the present embodiment, whether or not the operation forchanging a photographing scene has been performed by a user is monitoredby monitoring at least one of changes in the focal length, panningoperation, the MF operation, and ranging operation. In a case where theoperation for changing a photographing scene has been performed, thefocus controller 121 sets the initialization flag for returning thesettings to respective initial values. The initial values refer to avalue of the setting which sets the ranging target AF area to the firstranging target AF area (standard) and a value of setting which sets theAF control mode to the first AF control mode (normal). Hereafter, theinitialization condition-monitoring process will be described withreference to the flowchart in FIG. 4.

In a step S401, the focus controller 121 monitors whether or not apredetermined amount or more of a zoom operation has been performed.Note that the predetermined amount can be set as desired. For example,in a case where a zoom operation which changes the focal length by 10%or more is performed, the focus controller 121 determines that theanswer to the question of the step S401 is affirmative (YES). If theanswer to the question of the step S401 is negative (NO), the processproceeds to a step S402. In the step S402, the focus controller 121determines whether or not panning has been detected. For example, thedetermination in the step S402 may be performed based on whether or notan output from an angular velocity sensor, not shown, provided in theimage capturing apparatus 100 indicates that panning has been performedto such a degree as will switch over the screen.

If the answer to the question of the step S402 is negative (NO), theprocess proceeds to a step S403. In the step S403, the focus controller121 determines whether or not an MF operation has been performed. If theanswer to the question of the step S403 is negative (NO) (if an MFoperation has not been performed), the process proceeds to a step S404.In the step S404, the focus controller 121 monitors ranging resultsobtained within the ranging target AF area and determines whether or notthere is a predetermined amount or more of change in the rangingresults. For example, the focus controller 121 determines whether or notan average of the whole ranging results within the second ranging targetAF area (wide) has changed by 20% or more.

If the answer to the question of the step S404 is negative (NO) (if thechanged amount in the ranging results is less than the predeterminedamount), the process proceeds to a step S405. In the step S405, thefocus controller 121 judges that the object has not been changed andsets the initialization flag to OFF. On the other hand, if one of theanswers to the questions of the steps S401 to S404 is affirmative (YES),the process proceeds to a step S406. In the step S406, the focuscontroller 121 judges that the object has been changed and sets theinitialization flag to ON. That is, if one of the answers to thequestions of the steps S401 to S404 is negative (YES), the AF setting ischanged to the first setting.

Next, the focus mode selection process performed in the step S301 inFIG. 3 will be described. FIG. 5 is a flowchart of the focus modeselection process. In a step S501, the focus controller 121 determineswhether or not the focus ring is being operated by a user's operation.If the answer to the question of the step S501 is affirmative (YES) (ifthe focus ring is being operated), the process proceeds to a step S502.In the step S502, the focus controller 121 sets the focus mode to the MFcontrol mode.

If the answer to the question of the step S501 is negative (NO) (if thefocus ring is not being operated), the process proceeds to a step S503.In the step S503, the focus controller 121 sets the focus mode to the AFcontrol mode. After execution of the step S502 or S503, the focuscontroller 121 terminates the focus mode selection process in FIG. 5.Here, the focus mode is sometimes changed by a switch for switchingbetween AF and MF before operating the focus lens 105. In the presentembodiment, the change between the AF control and the MF control isseamlessly performed, and hence the AF control mode is changed accordingto whether or not the focus lens 105 is operated. This control is alsoreferred to as the fulltime manual focus.

Next, the MF process performed in the step S311 in FIG. 3 will bedescribed. The MF process is executed when the MF control mode isselected. FIG. 6 is a flowchart of the MF process. In a step S601, thefocus controller 121 controls the focus lens-driving source 112 to drivethe focus lens 105 in the optical axis direction in accordance withrotation of the focus ring based on a user's operation (MF operation).In a step S602, the focus controller 121 records a driving amount of thefocus ring moved based on the user's operation as an MF operation amountby a user. The MF operation amount may be an operation time of the MFoperation. The MF operation amount is continuously accumulated andrecorded as long as the MF control mode continues, and accumulation ofthe MF operation amount is terminated when the MF control mode ischanged to the AF control mode. Then, the recorded MF operation amountis reset when the AF control mode is changed to the MF control mode, andaccumulation of the MF operation amount is started again.

Although the step S601 in FIG. 6 shows an example in which the focuslens 105 is driven in the optical axis direction based on the control ofthe focus controller 121, the focus lens 105 may be driven by anothermethod. For example, in a case where the focus ring and the focus lens105 are mechanically connected via a gear and the like, the focus lens105 can be driven by operating the focus ring. In this case, the controlby the focus controller 121 is not required.

Further, the driving of the focus lens 105 in the MF control mode may beperformed based on an operation other than the operation of the focusring. For example, the focus lens 105 may be driven by an operationmember, such as a remote controller connected to the image capturingapparatus 100. Further, information other than the MF operation amountmay be recorded in the step S602. For example, there may recorded adriving amount of the focus lens 105 driven in accordance with a user'soperation, an amount of change in defocus amount, caused by driving thefocus lens 105, a value obtained by converting the driving amount of thefocus lens 105 to an amount of change in the corresponding defocusamount, or the like.

Next, a process for setting the ranging target AF area and the AFcontrol mode, performed in the step S304 in FIG. 3, will be described.FIGS. 7A to 7H are diagrams showing a positional relationship betweenobjects and the focus lens 105 and an example of a variety of screens.FIG. 8 is a flowchart of the process for setting the ranging target AFarea and the AF control mode immediately after the focus mode isswitched from the MF control mode to the AF control mode. In the processin FIG. 8, the focus controller 121 sets the ranging target AF area andthe AF control mode according to the MF operation and the rangingresults, for each of the following three cases.

The first case is a case where the main object is changed from an objectbrought into focus by AF to a different object in the center or itsvicinity of the screen by a user's operation. For example, there isassumed a case where the AF control is performed on an object differentfrom the object having been in focus through AF, by setting the same asa main object e.g. due to perspective conflict. In the first case, theranging target AF area is set to the first ranging target AF area(standard), and the AF control mode is set to the second AF control mode(limit).

The second case is a case where the main object is changed to adifferent object which is not in the center or its vicinity of thescreen by a user's operation. For example, there is assumed a case wherewhen a main object exists outside the ranging target AF area in thecenter and its vicinity of the screen, the AF control is performed onthe main object existing outside the ranging target AF area. In thesecond case, the ranging target AF area is set to the second rangingtarget AF area (wide), and the AF control mode is set to the second AFcontrol mode (limit).

The third case is a case where an erroneous MF operation is performed bya user or a case where although an MF operation is performed, the mainobject is not changed. For example, as the third case, there is assumeda case where a focusing operation is performed from a state in which ablur has occurred. In the third case, the ranging target AF area is setto the first ranging target AF area (standard), and the AF control modeis set to the first AF control mode (normal). This setting is the firstsetting.

FIG. 7A is a diagram showing an example of a positional relationshipbetween objects and the focus lens 105. An example illustrated in FIG.7A shows an infinity object 702 and a close object 703. Further, FIG. 7Ashows a position 712 of the focus lens 105 for focusing on the infinityobject 702, a position 714 of the focus lens 105 for focusing on theclose object 703, and a position 713 of the focus lens 105 for focusingon an object in an intermediate position between the position 712 forfocusing on the infinity object 702 and the position 714 for focusing onthe close object 703. A range 715 indicates a predetermined range(in-focus range) for determining an in-focus object.

FIG. 7B is a diagram showing an example of two ranging target AF areas.A first ranging target AF area (standard) 704 is a ranging target AFarea set when the focus lens 105 is in the position 714. The closeobject 703 is outside the first ranging target AF area (standard) 704,and hence in the normal AF control, it is impossible to focus on theclose object 703. When the user intends to focus on the close object 703and performs the MF operation by rotating the focus ring of the imagecapturing apparatus 100, the focus lens 105 is driven to move to theposition 714 in FIG. 7A. With this, it is possible to focus on the closeobject 703.

When the user's MF operation is stopped in this state, the close object703 is within the predetermined range 715 for determining an in-focusobject. Therefore, the focus controller 121 can determine that the mainobject has been changed to the close object 703 by the user's operation.At this time, the focus controller 121 changes the ranging target AFarea from the first ranging target AF area (standard) to the secondranging target AF area (wide) 716 appearing in FIG. 7C. With this, theclose object 703 is in the second ranging target AF area (wide) 716, andhence it is possible to focus on the close object 703.

Then, the focus controller 121 disposes a track frame 718 for anin-focus position 717 of the close object 703, in the state in which theranging target AF area is set to the second ranging target AF area(wide) 716. The track frame 718 will be described hereinafter. Further,the focus controller 121 changes the AF control mode from the first AFcontrol mode (normal) to the second AF control mode (limit). With this,even when another object appears in the center of the screen, change ofthe main object from the close object 703 is prevented, and hence it ispossible to maintain the in-focus state of the close object 703 in thein-focus position 717.

FIG. 7D is a diagram showing an example of a maximum ranging target AFarea 719. The maximum ranging target AF area 719 corresponds to theranging area 201 shown in FIG. 2. Here, there is assumed a case wherethe focus lens 105 is in the position 713 in FIG. 7A. In this case, theclose object 703 as the main object does not exist in the predeterminedrange 715 for determining an in-focus object. This case is presumed tobe the above-mentioned third case. Therefore, the ranging target AF areais set to the first ranging target AF area (standard), and the AFcontrol mode is set to the first AF control mode (normal).

FIG. 8 is a flowchart of the setting process performed in the step S304in FIG. 3. In a step S801, the focus controller 121 determines anin-focus object and selects a frame based on ranging results. The focuscontroller 121 selects a frame having the smallest ranging result (frameclosest to the in-focus state) from the maximum ranging target AF area719 shown in FIG. 7D. In a case where there are a plurality of frameseach having a ranging result smaller than a predetermined value (framesclose to the in-focus state), the focus controller 121 may select aframe in the center and its vicinity of the screen, or select thecentroid of a plurality of frames having the same ranging result byreferring to adjacent frames. Note that the selected frame ishereinafter referred to as the ranging result-based selected frame. Theranging result-based selected frame is selected in a case where there isan object.

In a step S802, the focus controller 121 determines whether or not amanual focus operation time (MF operation time) is not shorter than apredetermined time period in the MF control mode. The determination inthe step S802 is processing for determining whether or not an MFoperation based on a user's intention has been performed. For example,in a case where the MF operation time is shorter than the predeterminedtime period (the operation time is short), this operation can be anerroneous operation. In this case, the focus controller 121 inhibitschange of the ranging target AF area and the AF control mode. Thepredetermined time period can be set to a desired time period, such as“0.4 seconds”. If it is determined in the step S802 that the operationamount of manual focus (MF operation amount) is smaller than apredetermined operation amount in the MF control mode, the focuscontroller 121 may inhibit change of the ranging target AF area and theAF control mode. Since the MF operation amount has been recorded in thestep S602 in FIG. 6, the focus controller 121 can determine whether ornot to inhibit change of the ranging target AF area and the AF controlmode based on the recorded MF operation amount.

If the answer to the question of the step S802 is affirmative (YES) (ifthe focusing operation time is not shorter than the predetermined timeperiod), the process proceeds to a step S803. In the step S803, thefocus controller 121 determines whether or not a ranging result-basedselected frame within a predetermined depth is included inside the firstranging target AF area (standard). In a case where a rangingresult-based selected frame within the predetermined depth is included,an object is detected. On the other hand, in a case where a rangingresult-based selected frame within the predetermined depth is notincluded, no object is detected. If the answer to the question of thestep S803 is affirmative (YES) (if a ranging result-based selected framewithin the predetermined depth is included inside the first rangingtarget AF area (standard)), the process proceeds to a step S804.

In the step S804, the focus controller 121 sets the ranging target AFarea to the first ranging target AF area (standard). The step S804 isprocessing for setting the ranging target AF area to the first rangingtarget AF area (standard) because the position of the rangingresult-based selected frame (position of the object) determined in thestep S801 is in the center or its vicinity of an image. In a step S805,the focus controller 121 sets the AF control mode to the second AFcontrol mode (limit). The step S805 is processing executed in a casewhere it is determined based on the object in the ranging result-basedselected frame determined in the step S801 that focusing is performed bythe MF operation on an object different from the object detected in theAF control mode before the focus control is changed to the MF controlmode. In this case, the focus controller 121 can maintain the focus onthe object aimed by the user, by setting the AF control mode to thesecond AF control mode (limit). In this case, automatic tracking isperformed for the object aimed by the user.

If the answer to the question of the step S803 is negative NO) (if aranging result-based selected frame within the predetermined depth isnot included inside the first ranging target AF area (standard)), theprocess proceeds to a step S806. In the step S806, the focus controller121 determines whether or not a ranging result-based selected framewithin the predetermined depth is outside the first ranging target AFarea (standard). At this time, the focus controller 121 determineswhether or not the ranging result-based selected frame determined in thestep S801 is outside the first ranging target AF area (standard) andwithin the range of the second ranging target AF area (wide). If theanswer to the question of the step S806 is affirmative (YES) (if theranging result-based selected frame within the predetermined depth isoutside the first ranging target AF area (standard)), the processproceeds to a step S807.

The predetermined depth mentioned in the steps S803 and S806 can be setto a desired value (such as three times as large as a proper depth). Ina case where the predetermined depth is set to a large value, thisincreases a possibility that after the MF operation is performed by theuser, AF is started with respect to an object other than the objectaimed by the user. Inversely, in a case where the predetermined depth isset to a small value, it is necessary to move the lens to the vicinityof the in-focus point with respect to the object aimed by the user. As aresult, a high level of skill is required to perform the user'soperation, and further, the monitor is required to have good visibility.For this reason, it is preferable that the predetermined depth is withina predetermined range from the proper depth.

In the step S807, the focus controller 121 sets the ranging target AFarea to the second ranging target AF area (wide). In this case, since itis determined that the object corresponding to the position of theranging result-based selected frame determined in the step S801 is in aposition not in the vicinity of the center, the focus controller 121executes the step S807. In a step S808, the focus controller 121 setsthe AF control mode to the second AF control mode (limit). In a casewhere the answer to the question of the step S806 is affirmative (YES),the focus controller 121 determines that focusing has been performed noton the object in the ranging result-based selected frame determined inthe step S801, but on an object based on the MF operation. Therefore,the focus controller 121 executes the step S807. With this, it ispossible to easily capture the object aimed by the user.

If the answer to the question of the step S802 is negative (NO), theprocess proceeds to a step S809. Further, if the answer to the questionof the step S806 is negative (NO), the process proceeds to the stepS809. In the step S809, the focus controller 121 sets the ranging targetAF area to the first ranging target AF area (standard). The step S809 isexecuted in a case where the focusing operation time is shorter than thepredetermined time period or in a case where no object is detected. Forexample, in a case where no ranging result-based selected frame isdetermined in the step S801, no object is detected. Further, in a casewhere it is determined that a ranging result-based selected framedetermined in the step S801 is not within the predetermined depth (in acase where the answers to the questions of the step S803 and the stepS806 are both negative (NO)), no object is detected. In a step S810, thefocus controller 121 sets the AF control mode to the first AF controlmode (normal). When the steps S809 and S810 are executed, the AF settingis changed to the first setting. After execution of the step S805, S808,or S810, the setting process in FIG. 8 is terminated.

Next, the AF process performed according to the AF control mode set inthe step S304 or S310 will be described. FIG. 9 is a diagram showing anexample of shifts of AF states in the AF process. In the presentembodiment, the AF process has the following three AF states:

catch (state focusing on an object, from a state in which a blur hasoccurred)

track (state of maintaining a state focused on an object)

wait (state no longer capable of maintaining a state focused on anobject)

When an instruction 901 for starting AF is provided from Default 900indicative of an initial value, the AF state is shifted to Catch 902. Ina case where an object is outside the predetermined depth (903), the AFstate of Catch 902 is maintained. In a case where the object enters thepredetermined depth (904), the AF state is shifted from Catch 902 toTrack 906. If the object is within the predetermined depth (905), the AFstate of Track 906 is maintained. In a case where an object goes outsidethe predetermined depth (907) from the AF state of Track 906, the AFstate is shifted to Wait 909. Further, in a case where the object ischanged in the AF state of Track 906 (912), the AF state is shifted toCatch 902.

In a case where a predetermined time period has not elapsed (910), theAF state of Wait 909 is maintained. In a case where the predeterminedtime period has elapsed (911), the AF state is shifted to Catch 902.Further, in a case where the object returns into the predetermined depth(908), the AF state is shifted to Track 906.

As described above, the focus controller 121 performs the AF processwhile shifting the AF state between the three AF states of Catch, Track,and Wait. Here, in a case where the AF control mode is set to the firstAF control mode (normal), the focus controller 121 shifts the AF statefrom Track 906 to Catch 902. On the other hand, in a case where the AFcontrol mode is set to the second AF control mode (limit), the focuscontroller 121 inhibits the AF state from being shifted from Track 906to Catch 902. That is, in this case, change of a object as the focusingtarget is inhibited. With this, focusing on the object aimed by the useris maintained.

FIGS. 10 and 11 are a flowchart of the AF process performed according tothe AF control mode. In a step S1001, the focus controller 121determines which of the AF states indicated in FIG. 9 the current AFstate is. If it is determined that the AF state is Catch, the processproceeds to a step S1002. If it is determined that the AF state isTrack, the process proceeds to a step S1007. If it is determined thatthe AF state is Wait, the process proceeds to a step S1012.

In the step S1002, the focus controller 121 sets a catch frame. FIG. 7Eis a diagram showing an example of the screen on which a catch frame 705is set in the vicinity of the center of the screen. As shown in FIG. 7E,the screen includes the infinity object 702 and the close object 703.Further, the first ranging target AF area (standard) 704 is indicated bybroken lines. The catch frame 705 includes a plurality of ranging areas.In a step S1003, the focus controller 121 acquires respective rangingresults of the plurality of ranging areas from the catch frame 705. In astep S1004, the focus controller 121 selects the closest ranging resultfrom the plurality of ranging results acquired in the step S1003. In theillustrated example in FIG. 7E, an in-focus area 706 is selected as theclosest ranging area.

In a step S1005, the focus controller 121 determines whether or not theranging result obtained from the closest ranging area selected in thestep S1004 indicates a substantially in-focus state. Even when theranging result obtained from the closest ranging area selected in thestep S1004 does not indicate a completely in-focus state, if the rangingresult indicates a state in-focus within a certain range, the focuscontroller 121 determines that the answer to the question of the stepS1005 is affirmative (YES) even when there is some deviation. If theanswer to the question of the step S1005 is negative (NO), the processproceeds to a step S1006. In the step S1006, the focus controller 121sets the AF state to Catch. After execution of the step S1006, theprocess proceeds to a step S1018. If the answer to the question of thestep S1005 is affirmative (YES), the process proceeds to a step S1011.

In the case where it is determined in the step S1001 that the AF stateis Track, in the step S1007, the focus controller 121 sets a track framearound the preceding in-focus area. In the illustrated example in FIG.7F, the track frame, denoted by reference numeral 707, is set around thein-focus area 706 (in-focus area 706 in FIG. 7E). The track frame 707includes a plurality of ranging areas. In a step S1008, the focuscontroller 121 acquires respective ranging results of the plurality ofranging areas from the track frame 707. In a step S1009, the focuscontroller 121 selects a ranging result closest to the in-focus statefrom the plurality of acquired ranging results.

In a step S1010, the focus controller 121 determines whether or not theranging result selected in the step S1009 indicates a substantiallyin-focus state. If the answer to the question of the step S1010 isaffirmative (YES), the process proceeds to the step S1011. In the stepS1011, the focus controller 121 maintains the AF state in Track. Afterexecution of the step S1011, the process proceeds to the step S1018. Ifthe answer to the question of the step S1010 is negative (NO), theprocess proceeds to a step S1017.

In the case where the AF state is Track, the processing for setting thetrack frame around the in-focus position of the object, and further,selecting a ranging area closest to the in-focus state from the trackframe (steps S1007 to S1011) is performed. By repeatedly executing thesteps S1007 to S1011, even when the object moves in an X-Y direction, itis possible to cause the focus to follow the movement of the object.

In the case where it is determined in the step S1001 that the AF stateis Wait, in the step S1012, the focus controller 121 sets a Wait framearound the in-focus position obtained when the AF state is set to Track.FIG. 7G is a diagram showing an example of a case where the object istemporarily outside the track frame 707. For example, when the userperforms an operation using the image capturing apparatus 100, if handshake, unintended panning, or the like occurs, the object is sometimestemporarily goes out of the track frame. In this case, there is apossibility that the object returns into the track frame again.Therefore, the focus controller 121 sets a Wait frame 708 to the sameposition as the position of the last track frame 707 set when the AFstate has been Track.

In a step S1013, the focus controller 121 acquires respective rangingresults of the plurality of ranging areas from the Wait frame 708. In astep S1014, the focus controller 121 selects a ranging result closest tothe in-focus state from the plurality of acquired ranging results. In astep S1015, the focus controller 121 determines whether or not theranging result closest to the in-focus state, selected in the stepS1004, indicates a substantially in-focus state. If the answer to thequestion of the step S1015 is affirmative (YES), the process proceeds tothe step S1011. In the step S1011, the focus controller 121 shifts theAF state to Track. If the answer to the question of the step S1015 isnegative (NO), the process proceeds to a step S1016.

In the step S1016, the focus controller 121 determines whether or notthe time period in which the AF state is Wait is longer than apredetermined time period. If the answer to the question of the stepS1016 is affirmative (YES), the process proceeds to the step S1006. In acase where the time period in which the AF state is Wait and the focusstate is not substantially in-focus state has continued for thepredetermined time period or more, there is assumed a situation in whichthe tracked object disappears from the screen or the object disappearsfrom the screen e.g. due to panning. In such a case, the focuscontroller 121 changes the AF control such that a focusing operation isperformed for a catch frame in the center and its vicinity of thescreen. On the other hand, if the answer to the question of the stepS1016 is negative (NO), the process proceeds to the step S1017. In thiscase, the focus controller 121 maintains the AF state in Wait.

In the step S1018, the focus controller 121 performs lens drivingaccording to the ranging result. At this time, the focus controller 121converts the ranging result selected in one of the S1004, S1009, andS1014 to a lens driving amount and provides a driving command to thefocus lens-driving source 112 that drives the focus lens 105. Afterexecution of the step S1018, the process proceeds to a step S1019 inFIG. 11.

In the step S1019, the focus controller 121 determines whether or notthe AF control mode is the first AF control mode (normal). If the answerto the question of the step S1019 is affirmative (YES) (if the AFcontrol mode is the first AF control mode (normal)), the processproceeds to a step S1020. In the step S1020, the focus controller 121sets an area for monitoring for a close object in the center and itsvicinity of the screen. In the illustrated example in FIG. 7H, themonitoring area, denoted by reference numeral 709, for a close object710, is set in the vicinity of the center of the screen.

The monitoring area includes a plurality of ranging areas. In a stepS1021, the focus controller 121 acquires respective ranging results fromthe plurality of ranging areas in the monitoring area for the closeobject. In a step S1022, the focus controller 121 determines a rangingresult on the nearer side of the current lens position (associated withthe position of the object currently in focus) out of the plurality ofranging results acquired in the step S1021.

In a step S1023, the focus controller 121 determines whether or notthere is a close object. At this time, if it is determined in the stepS1022 that there is a ranging result on the nearer side of the currentlens position, the focus controller 121 determines that a close objecthas appeared. In this case, the focus controller 121 determines that theanswer to the question of the step S1023 is affirmative (YES). If theanswer to the question of the step S1023 is affirmative (YES), theprocess proceeds to a step S1024. In the step S1024, the focuscontroller 121 shifts the AF state to Catch. In a case where a closeobject has appeared, the AF state is shifted to Catch, whereby it ispossible to shift the AF control to the AF processing for tracking theobject again. Then, the focus controller 121 terminates the AF processperformed according to the AF control mode.

If the answer to the question of the step S1019 is negative (NO), or ifthe answer to the question of the step S1023 is negative (NO), the focuscontroller 121 terminates the AF process performed according to the AFcontrol mode in FIGS. 10 and 11. By executing the steps S1019 to S1024,the close object 710 rather than the infinite object 702 is alwaysmonitored for, as shown in FIG. 7H. With this, in a case where the closeobject 710 appears on the screen, it is possible to focus on the closeobject 710.

As described above, in the present embodiment, when the focus control isswitched from the AF control mode to the MF control mode by a user'soperation, and then switched from the MF control mode to the AF controlmode, the AF control mode is varied immediately after being switchedfrom the MF control mode to the AF control mode. In a case where anobject is detected in the MF control mode, the in-focus state on thedetected object is maintained, whereas in a case where no object isdetected in the MF control mode, the focus control mode is returned tothe AF control mode set before being switched to the MF control mode.With this, the versatile AF is realized, and it is possible to realizehighly dedicated AF with respect to an object aimed by a user in the MFcontrol mode. As a result, it is possible to prevent an object aimed bya user from being excluded from the focusing target.

Further, in a case where an object exists outside the ranging target AFarea set in the AF control mode before being switched to the MF controlmode, the ranging target AF area is expanded in the AF control modeswitched from the MF control mode. With this, it is possible to realizethe AF with respect to the object aimed by the user. Further, it ispossible to prevent focusing on an object which is not intended by theuser. Further, in a case where an object aimed by the user is detectedfrom the expanded ranging target AF area, the in-focus state withrespect to the detected object is maintained. Therefore, even in a casewhere an object exists outside the ranging target AF area set in the AFcontrol mode before being switched to the MF control mode, it ispossible to realize the versatile AF and the exclusive AF.

Other Embodiments

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2021-060781 filed Mar. 31, 2021, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A focus control device comprising: a processor;and a memory storing a program which, when executed by the processor,causes the focus control device to: perform focus adjustment by usingone of autofocus and manual focus; and control, when focus control isswitched from the autofocus to the manual focus, and then switched tothe autofocus, whether to perform focus adjustment with settings of theautofocus set before being switched to the manual focus or with settingsof the autofocus to be set after being switched from the manual focus,according to whether or not there is an object focused by the manualfocus.
 2. The focus control device according to claim 1, wherein thesettings of the autofocus set after the switching are settings formaintaining, in a case where there is an object focused by the manualfocus, an in-focus state of the object, and settings for focusing on anarea in a center of a screen in a case where there is no object focusedby the manual focus.
 3. The focus control device according to claim 2,wherein the program when executed by the processor further causes thefocus control device to inhibit change of the object in a case wheresettings for maintaining the in-focus state of the object have been set.4. The focus control device according to claim 1, wherein the programwhen executed by the processor further causes the focus control deviceto expand, in a case where the object exists outside a ranging targetarea set by the settings of the autofocus set before being switched tothe manual focus, the ranging target area.
 5. The focus control deviceaccording to claim 1, wherein the program when executed by the processorfurther causes the focus control device to perform the control, in acase where an image acquired one period after an image was acquired withthe settings of the manual focus is an image acquired with the settingsof the autofocus set after the switching.
 6. The focus control deviceaccording to claim 1, wherein the program when executed by the processorfurther causes the focus control device to change the settings to thesettings of the autofocus set before the switching, in a case where anoperation for changing a photographing scene is performed.
 7. The focuscontrol device according to claim 6, wherein whether or not theoperation for changing a photographing scene has been performed isdetermined based on whether a predetermined amount or more of a zoomoperation has been performed, panning has been detected, a manual focusoperation has been performed, or there is a predetermined amount or moreof change in the ranging results.
 8. The focus control device accordingto claim 1, wherein the program when executed by the processor furthercauses the focus control device to inhibit change to the settings of theautofocus to be set after the switching, in a case where a time periodover which the manual focus operation has been performed is shorter thana predetermined time period.
 9. The focus control device according toclaim 1, wherein the program when executed by the processor furthercauses the focus control device to inhibit change to the settings of theautofocus to be set after the switching, in a case where an operationamount of the manual focus operation is smaller than a predeterminedoperation amount.
 10. The focus control device according to claim 1,wherein the program when executed by the processor further causes thefocus control device to display a frame for identifying an area as atarget of the autofocus.
 11. A focus control device comprising: aprocessor; and a memory storing a program which, when executed by theprocessor, causes the focus control device to: perform focus adjustmentby using one of autofocus and manual focus; and perform, when the focuscontrol is switched from the autofocus to the manual focus, and thenswitched from the manual focus to the autofocus, control for expanding aranging target area to be set by settings of the autofocus after beingswitched from the manual focus from a ranging target area set bysettings of the autofocus before being switched to the manual focus. 12.The focus control device according to claim 11, wherein the program whenexecuted by the processor further causes the focus control device toexpand, in a case where an object exists outside the ranging target areaset by the settings of the autofocus set before being switched to themanual focus, the ranging target area.
 13. The focus control deviceaccording to claim 11, wherein the program when executed by theprocessor further causes the focus control device to perform the controlin a case where an image acquired one period after an image was acquiredwith settings of the manual focus is an image acquired with the settingsof the autofocus set after the switching.
 14. The focus control deviceaccording to claim 11, wherein the program when executed by theprocessor further causes the focus control device to change the settingto the setting of the autofocus, set before the switching, in a casewhere an operation for changing a photographing scene is performed. 15.The focus control device according to claim 14, wherein whether or notthe operation for changing the photographing scene has been performed isdetermined based on whether a predetermined amount or more of a zoomoperation has been performed, panning has been detected, a manual focusoperation has been performed, or there is a predetermined amount or moreof change in the ranging results.
 16. The focus control device accordingto claim 11, wherein the program when executed by the processor furthercauses the focus control device to inhibit change to the settings of theautofocus to be set after the switching, in a case where a time periodover which the manual focus operation has been performed is shorter thana predetermined time period.
 17. The focus control device according toclaim 11, wherein the program when executed by the processor furthercauses the focus control device to inhibit change to the settings of theautofocus to be set after the switching, in a case where an operationamount of the manual focus operation is smaller than a predeterminedoperation amount.
 18. The focus control device according to claim 11,wherein the program when executed by the processor further causes thefocus control device to display a frame for identifying an area as atarget of the autofocus.
 19. A focus controlling method that makes itpossible to perform focus adjustment by using one of autofocus andmanual focus, comprising: controlling, when focus control is switchedfrom the autofocus to the manual focus, and then switched to theautofocus, whether to perform focus adjustment with settings of theautofocus set before being switched to the manual focus, or withsettings of the autofocus to be set after being switched from the manualfocus, according to whether or not there is an object focused by themanual focus.
 20. A focus controlling method that makes it possible toperform focus adjustment by using one of autofocus and manual focus,comprising: performing, when the focus control is switched from theautofocus to the manual focus, and then switched from the manual focusto the autofocus, control for expanding a ranging target area to be setby settings of the autofocus after being switched from the manual focusfrom a ranging target area set by settings of the autofocus before beingswitched to the manual focus.
 21. A non-transitory computer-readablestorage medium storing a program for causing a computer to execute afocus controlling method that makes it possible to perform focusadjustment by using one of autofocus and manual focus, wherein themethod comprises: controlling, when focus control is switched from theautofocus to the manual focus, and then switched to the autofocus,whether to perform focus adjustment with settings of the autofocus setbefore being switched to the manual focus, or with settings of theautofocus to be set after being switched from the manual focus,according to whether or not there is an object focused by the manualfocus.
 22. A non-transitory computer-readable storage medium storing aprogram for causing a computer to execute a focus controlling methodthat makes it possible to perform focus adjustment by using one ofautofocus and manual focus, wherein the method comprises: performing,when the focus control is switched from the autofocus to the manualfocus, and then switched from the manual focus to the autofocus, controlfor expanding a ranging target area to be set by settings of theautofocus after being switched from the manual focus from a rangingtarget area set by settings of the autofocus before being switched tothe manual focus.